package ocm.itheima;

import org.junit.Test;

/**
 * @author LiangTianQi
 * @describe
 * @date 2020/11/10 10:40
 */
public class demo {

    @Test
    public void testSubstring() {
        String name = "132.pig";
        int index = name.lastIndexOf(".");
        System.out.println(index);
        String substring = name.substring(index-1);
        System.out.println(substring);
    }
}
